<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/3/4
  Time: 15:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>记账管理</title>
</head>
<link href="/css/style.css" rel="stylesheet" type="text/css"/>
<body>
<div class="bigbody">
    <h1>记账管理</h1>
    <form class="text" method="post" action="/bills/index" name="test">
        <select name="type_id">
            <option value="0">不限</option>
            <c:forEach items="${bill_type}" var="bill">
                <option value="${bill.id}">${bill.name}</option>
            </c:forEach>
        </select>
        时间从:<input type="text" class="firstTime" name="startTime"/>
        到<input type="text" class="lastTime" name="endTime"/>
        <input type="submit" class="select" name="select" value="查询"/>
        <a href="/bills/toAdd"><input type="button" value="记账"/></a>
    </form>
    <table align="center">
        <tr>
            <td width="70px">标题</td>
            <td width="120px">记账时间</td>
            <td width="70px">类别</td>
            <td width="90px">金额</td>
            <td>说明</td>
        </tr>
        <c:if test="${bills == null}">
            <tr>
                <td colspan="5">
                    没有找到任何账单信息！
                </td>
            </tr>
        </c:if>
        <c:if test="${bills != null}">
            <c:forEach items="${bills}" var="bill">
                <tr>
                    <td>${bill.title}</td>
                        <%--<td><fmt:formatDate pattern="yyyy-MM-dd" value="${bill.bill_time}"/></td>--%>
                    <td>${bill.bill_time}</td>
                    <td>${bill.bill.name}</td>
                    <td>${bill.price}</td>
                    <td>${bill.explain}</td>
                </tr>
            </c:forEach>
        </c:if>
    </table>
</div>
</body>
<script type="text/javascript" src="/js/jquery-3.3.1.js"></script>
<script type="text/javascript" src="/js/js.js"></script>
</html>
